package com.oracle.sbdb.servlet.model;

import java.sql.Date;

public class BugUpdates {
	private Integer bugID;
	/*
	 * This field is the GID of the engineer who fills this updates
	 */
	private String engineer;
	private String time;
	private Boolean hidden;
	private String content;
	
	public BugUpdates(){};
	
	public BugUpdates(Integer bugID, String engineer, String time, Boolean hidden, String content){
		setBugID(bugID);
		setEngineer(engineer);
		setTime(time);
		setHidden(hidden);
		setContent(content);
	}
	
	public BugUpdates(Integer bugID, String engineer, Boolean hidden, String content){
		setBugID(bugID);
		setEngineer(engineer);
		setCurrentTime();
		setHidden(hidden);
		setContent(content);
	}
	
	public Integer getBugID() {
		return bugID;
	}

	public void setBugID(Integer bugID) {
		this.bugID = bugID;
	}

	public String getEngineer() {
		return engineer;
	}

	public void setEngineer(String engineer) {
		this.engineer = engineer;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}
	
	public void setCurrentTime() {
		this.time = String.valueOf(System.currentTimeMillis());
	}

	public Boolean getHidden() {
		return hidden;
	}

	public void setHidden(Boolean hidden) {
		this.hidden = hidden;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String toString() {
		return getEngineer() + ": " + getContent();
	}
}
